#include <bits/stdc++.h>
using namespace std;

using ll = long long;

set<ll>s;
set<ll>::iterator it;
int main()
{
    freopen("secret.in","r",stdin);
    freopen("secret.out","w",stdout);
    ll n,q,x,i;
    double ans;
    char pd;
    cin>>n>>q;
    for(i=1;i<=n;i++)
    {
        cin>>x;
        s.insert(x);
    }
    for(i=1;i<=q;i++)
    {
        cin>>pd>>x;
        if(pd=='+')
        {
            s.insert(x);
        }
        if(pd=='-')
        {
            s.erase(x);
        }
        if(pd=='?')
        {
            ans=0x7f7f7f7f;
            it=s.upper_bound(x);
            if(it!=s.end())
            {
                ans=min(ans,max(*it-*s.begin(),*(--s.end())-x)/2.0);
            }
            it=s.find(x);
            if(it!=s.begin())
            {
                it=prev(it);
                ans=min(ans,max(x-*s.begin(),*(--s.end())-*it)/2.0);
            }
            printf("%.2lf\n",ans);
        }	
    }
    fclose(stdin);
    fclose(stdout);	
    return 0;
}